package com.rogue.feign;

import com.rogue.common.core.utils.ResultDTO;
import com.rogue.domain.dto.UserDTO;
import com.rogue.domain.entity.SysUser;
import com.rogue.domain.vo.UserRoleVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author YeahLiang
 * @Create 2022/04/14
 */
@FeignClient("hs-system")
public interface SystemFeign {

    @GetMapping("/user/easyGetOneUser/{id}")
    ResultDTO<SysUser> easyGetOneUser(@PathVariable("id") Long id);

    @GetMapping("/user/getUserAndRole/{id}")
    ResultDTO<UserRoleVo> getUserAndRole(@PathVariable("id") Long id);

    @GetMapping("/user/getUserAndRoleByName")
    ResultDTO<UserRoleVo> getUserAndRoleByName(@RequestParam("name") String name);

    @RequestMapping("/easyUpdateUser")
    public ResultDTO<Boolean> easyUpdateUser(@RequestBody UserDTO userDTO);
}
